//
//  ST_AICenterPeculiarityDetailCell.swift
//  btvideo
//
//  Created by mac on 2020/1/10.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SnapKit
import SwifterSwift

var PairsCenterPeculiarityImageContainerHeight:CGFloat = {
    return (ScreenWidth-30)/345.0*200
}()


class ST_PairsCenterPeculiarityDetailCell: UITableViewCell {

    

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        contentView.backgroundColor = Color.white
        
//        contentView.backgroundColor = .random
        
        contentView.addSubview(images_container_view)
        contentView.addSubview(regimentation_label)
        contentView.addSubview(regimentation_sub_label)
        
        images_container_view.snp.makeConstraints { (make) in
            make.height.equalTo(200)
            make.left.equalToSuperview().offset(15)
            make.right.equalToSuperview().offset(-15)
            make.top.equalToSuperview().offset(15)
        }
        
        regimentation_label.snp.makeConstraints { (make) in
            make.left.equalTo(regimentation_sub_label)
            make.top.equalTo(images_container_view.snp.bottom).offset(10)
        }
        
        regimentation_sub_label.snp.makeConstraints { (make) in
            make.top.equalTo(regimentation_label.snp.bottom).offset(2)
            make.left.equalToSuperview().offset(20)
        }
        
//        contentView.backgroundColor = Color.random
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//        MARK:-Properties
//    lazy var bottom_view:UIView = {
//        let control = UIView()
////        control.cornerRadius = 10
//        control.backgroundColor = Color.white
//        return control
//    }()
    
    lazy var images_container_view:UIView = {
       let control = UIView()
        control.cornerRadius = 20
        return control
    }()
    
    lazy var regimentation_label:UILabel = {
        let control = UILabel.init()
//        control.numberOfLines = 0
        control.textColor = Color.init(hexString: "#333333")
        control.font = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.semibold)
        return control
    }()
    
    lazy var regimentation_sub_label:UILabel = {
        let control = UILabel.init()
        control.text = "  "
        control.textColor = Color.init(hexString: "#ACB4C0")
        control.font = UIFont.systemFont(ofSize: 12, weight: UIFont.Weight.regular)
        return control
    }()

//    lazy var icon_image_view:UIImageView = {
//        let control = UIImageView()
//        control.contentMode = UIView.ContentMode.scaleAspectFill
//        control.cornerRadius = 10
//        return control
//    }()

    //    MARK:- Bind Model
    var model = ST_PairsPeculiarity(){
        didSet{
            bind_model_view()
        }
    }
    
    func bind_model_view(){
        
//        icon_image_view.pin_setImage(from: model.image.url, completed: nil)
        
        regimentation_label.text = model.name
        
        regimentation_sub_label.text = model.remark
    }
}


